Skip to content

Conversation

@Omega359
Copy link
Contributor

@Omega359 Omega359 commented Aug 14, 2024

Which issue does this PR close?

Closes #11984

Rationale for this change

Code cleanup, performance improvement.

What changes are included in this PR?

Code, benchmark.

Are these changes tested?

Yes

Are there any user-facing changes?

No

@github-actions github-actions bot added the functions Changes to functions implementation label Aug 14, 2024
@Omega359 Omega359 marked this pull request as ready for review August 14, 2024 15:35
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me -- thank you @Omega359

group.bench_function(BenchmarkId::new("largeutf8 type", size), |b| {
b.iter(|| criterion::black_box(rpad().invoke(&args).unwrap()))
});
//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason to leave this commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rpad update with utf8view wasn't committed yet. I know it would work anyways but I think now that rpad update is committed it's good to uncomment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can make a follow on PR with cleaning up rpad and applying the same pattern. I filed #11997 to track that idea

return exec_err!("lpad requested length {length} too large");
}
let array = if fill_array.is_none() {
let mut builder: GenericStringBuilder<T> = GenericStringBuilder::new();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve lpad udf by using a GenericStringBuilder

2 participants